﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DanhSach.ascx.cs" Inherits="NCS.Module.DonVi.Admin.UserControls.DanhSach" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<script runat="server">

    protected void grid_Sorting(object sender, GridViewSortEventArgs e)
    {

    }

    protected void grid_RowEditing(object sender, GridViewEditEventArgs e)
    {

    }
</script>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td>
            Lọc theo:
            <asp:DropDownList ID="ddlFilter" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlFilter_SelectedIndexChanged"
                Width="188px">
            </asp:DropDownList></td>
    </tr>
    <tr>
        <td>
            <asp:GridView ID="grid" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                OnRowDataBound="grid_RowDataBound" OnRowEditing="grid_RowEditing" OnPageIndexChanging="grid_OnPageIndexChanging"
                Width="100%" OnRowCommand="grid_RowCommand" OnSorting="grid_Sorting" CellPadding="4"
                ForeColor="#333333" GridLines="None">
                <AlternatingRowStyle CssClass="Grid_Raw2" BackColor="White" ForeColor="#284775" />
                <RowStyle CssClass="Grid_Raw1" BackColor="#F7F6F3" ForeColor="#333333" />
                <HeaderStyle Font-Bold="True" CssClass="Grid_Top" BackColor="#5D7B9D" ForeColor="White">
                </HeaderStyle>
                <Columns>
                    <asp:TemplateField HeaderText="ID">
                        <HeaderStyle HorizontalAlign="Center" Width="30px"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        <HeaderTemplate>
                            <asp:Literal ID="Literal1" Text="ID" runat="server"></asp:Literal>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Literal ID="ltrID" Text='<%#Eval("DonViID") %>' runat="server"></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Stt">
                        <HeaderStyle Width="30px" />
                        <ItemStyle Width="30px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Tên đơn vị">
                        <HeaderStyle HorizontalAlign="Center" Width="30%"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        <HeaderTemplate>
                            <asp:Literal ID="ltrTenDonViHeader" Text="Tên đơn vị" runat="server"></asp:Literal>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Literal ID="ltrTenDonVi" Text='<%#Eval("TenDonVi") %>' runat="server"></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Cấp cha">
                        <HeaderStyle HorizontalAlign="Center" Width="30%"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        <HeaderTemplate>
                            <asp:Literal ID="ltrCapChaHeader" Text="Cấp cha" runat="server"></asp:Literal>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Literal ID="ltrCapCha" Text='<%#Eval("CapChaID") %>' runat="server"></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Thứ tự">
                        <HeaderStyle HorizontalAlign="Center" Width="10%"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        <HeaderTemplate>
                            <asp:Button ID="Button1" runat="server" Width="61px" CssClass="Button" CommandName="sort"
                                Text="Sắp xếp"></asp:Button>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:DropDownList ID="dropIndex" runat="server" Width="61px">
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Trạng thái">
                        <HeaderStyle HorizontalAlign="Center" Width="10%"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderTemplate>
                            <asp:Literal ID="Literal3" Text="Trạng thái" runat="server"></asp:Literal>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Literal ID="ltrTrangThai" runat="server" Text='<%# Eval("TrangThai") %>'></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Thao tác">
                        <HeaderStyle Width="10%" />
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        <ItemTemplate>
                            <asp:Button ID="btnEdit" runat="server" CommandArgument='<%# Eval("DonViID") %>'
                                CommandName="edit" CssClass="Button" Text="Sửa" Width="60px" />&nbsp;
                            <asp:Button ID="btnDel" runat="server" CommandArgument='<%# Eval("DonViID") %>'
                                CommandName="del" CssClass="Button" Text="Xóa" Width="60px" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#999999" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            </asp:GridView>
        </td>
    </tr>
    <tr>
        <td height="30">
            &nbsp;</td>
    </tr>
    <tr>
        <td scope="col">
            <strong>Thêm đơn vị: </strong>
        </td>
    </tr>
    <tr class="InputBox">
        <td>
            <table>
                <tr>
                    <td>
                        <strong>ID: </strong>
                    </td>
                    <td align="left" style="width: 328px">
                        <asp:TextBox ID="txtID" runat="server" Enabled="False" Width="65px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        Tên đơn vị :</td>
                    <td align="left" style="width: 500px">
                        <asp:TextBox ID="txtTenDonVi" runat="server" Width="500px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        Cấp cha</td>
                    <td>
                        <asp:DropDownList ID="ddlCapCha" runat="server" Width="500px">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td>
                        Thứ tự:</td>
                    <td style="width: 328px">
                        <asp:DropDownList runat="server" ID="ddlThuTu">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td>
                        Nội dung:</td>
                    <td align="left" style="width: 800px">
                        <CKEditor:CKEditorControl ID="CKNoiDung" Height="400px" runat="server"></CKEditor:CKEditorControl>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="InputBox">
        <td>
            <asp:Button ID="btnAddNew" runat="server" CssClass="Button" Text="Thêm mới" Width="76px"
                OnClick="btnAddNew_Click" />
            <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Cập nhật"
                CssClass="Button" /></td>
    </tr>
</table>